Next | Prev | Up | Top | Contents | Index

Controlling the Target Architecture

Some options control the target architecture for which code is generated; most of the options are in the -TARG: option group. The options are described below.

-32 -n32 or -64

This option determines the base ABI to be assumed, either the 32-bit ABI for MIPS I/II targets, or the new 32-bit (n32) and 64-bit ABI for MIPS III/IV targets.

-mips[1234] or -TARG:isa=mips[1234]


This option identifies the instruction set architecture (ISA) to be used for generated code. It defaults to MIPS I for 32-bit compilations, and to MIPS III for n32 and 64-bit compilations. However, you can specify higher ABIs for either, at the cost of producing an executable that will not run on the earlier architectures. The linker (ld) does not understand the -TARG group, so you must use the short form if linking is to be invoked as part of the compilation.

-TARG:madd[=(ON|OFF)]


This option enables/disables use of the multiply/add instructions for MIPS IV targets. These instructions multiply two floating point operands and then add (or subtract) a third with a single roundoff of the final result. They are therefore slightly more accurate than the usual discrete operations, and may cause results not to match baselines from other targets. This option may be used to determine whether observed differences are due to madds. This option is ON by default for MIPS IV targets; otherwise, it is ignored.

-TARG:processor=(r3000|r4000|r8000)


This option identifies the probable execution target of the code to be generated; it will be scheduled for optimal execution on that target. This option does not affect the ABI and/or ISA selected by the options described above (that is, it has no effect on which target processors can correctly execute the program, but just on how well they do so).
The command below produces MIPS III code conforming to the 64-bit ABI (and therefore executable on any MIPS III or above processor), which is optimized to run on the R8000.

cc -64 -TARG:proc=r8000 ...

Next | Prev | Up | Top | Contents | Index